using System;
using Publish.Enum;
using System.Collections.Generic;

namespace Publish.Services.SocketUdp
{
    public class LanList
    {
        #region Property

        /// <summary>
        /// 当前的局域网泛型列表
        /// </summary>
        public static List<LanInfo> CurrentLanList { get; set; }

        #endregion

        #region Method

        /// <summary>
        /// 设置某个用户的交谈状态
        /// </summary>
        /// <param name="host"></param>
        /// <param name="state"></param>
        public static LanInfo SetTalkState(String host, TalkState state)
        {
            LanInfo lanInfo = CurrentLanList.Find(x => x.Host == host);
            if (lanInfo != null)
            {
                lanInfo.State = state;
            }
            return lanInfo;
        }

        #endregion
    }
}
